package 编程题;

public class  _1t implements Runnable{
        private String xiancheng;

        public _1t(String xiancheng) {
            this.xiancheng = xiancheng;
        }

        @Override
        public void run() {
            for (int i = 0; i < 1100; i++) {
                System.out.println(xiancheng + ": " + i);
                try {
                    Thread.sleep(300);
                } catch (InterruptedException e) {
                    System.out.println(xiancheng + "InterruptedException");
                }
            }
        }
    }

     class Main {
        public static void main(String[] args) {
            Thread t1 = new Thread(new _1t("xiancheng 1"));
            Thread t2 = new Thread(new _1t("xiancheng 2"));
            Thread t3 = new Thread(new _1t("xiancheng 3"));
            t1.setPriority(Thread.MIN_PRIORITY);
            t2.setPriority(Thread.MAX_PRIORITY);
            t3.setPriority(Thread.NORM_PRIORITY);
            t1.start();
            t2.start();
            t3.start();
        }
    }

